# -*- coding: utf-8 -*-

from keras.models import load_model
from tensorflow import keras
import tensorflow as tf

image_size = (180, 180)

img = keras.preprocessing.image.load_img(
    "../animals/dog/1.jpg", target_size=image_size
)
img_array = keras.preprocessing.image.img_to_array(img)
img_array = tf.expand_dims(img_array, 0)  # Create batch axis

model = load_model('model.h5')

predictions = model.predict(img_array)
score = predictions[0]
print(
    "This image is %.2f percent cat and %.2f percent dog."
    % (100 * (1 - score), 100 * score)
)